from django.contrib import admin

# Register your models here.
from django.contrib import admin

# Register your models here.
from web_testing.models import WebCase, WebCaseStep, WebProject


class WebCaseStepTabularInline(admin.TabularInline):
    model = WebCaseStep
    extra = 1


@admin.register(WebProject)
class WebProjectAdmin(admin.ModelAdmin):
    list_display = ['id', 'project_code', 'project_name', 'project_description', 'create_time', 'user']


@admin.register(WebCase)
class WebCaseAdmin(admin.ModelAdmin):
    list_display = ['id', 'case_code', 'case_name', 'priority', 'pre_case', 'create_time', 'status', 'web_project']
    inlines = [
        WebCaseStepTabularInline,
    ]


@admin.register(WebCaseStep)
class WebCaseStepAdmin(admin.ModelAdmin):
    list_display = ['sequence', 'step_description', 'command', 'locate_method', 'locate_value', 'value', 'web_case']
